package com.grape.dp.handler.controller;

import com.grape.dp.handler.handler.GatewayHandler;
import com.grape.dp.handler.service.GatewayHandlerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 描述:HandlerController
 * @author: myx
 * @date: 2019/7/22 0022
 * Copyright © 2019-grape. All rights reserved.
 */
@RestController
public class HandlerController {
    @Autowired
    private GatewayHandlerService gatewayHandlerService;

    /**
     * 描述:HandlerController 数据库实现责任链模式
     * @author: myx
     * @date: 2019/7/22 0022
     * Copyright © 2019-grape. All rights reserved.
     */
    @RequestMapping("/client")
    public String client() {
        GatewayHandler firstGatewayHandler = gatewayHandlerService.getFirstGatewayHandler();
        firstGatewayHandler.service();
        return "success";
    }
}

